<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/commons/taglibs.jsp" %>
<!DOCTYPE HTML>
<html>
  <head>
  <title>bvcQrCode列表</title>
  </head>
  <body>
 	<table class="table table-striped table-bordered table-hover" id="bvcQrCodeList">
 	<thead>
	<tr>
			<td>序号</td>
		 	<td>二维码渠道名称</td>
		 	<td>类型</td>
		 	<td>二维码url</td>
		 	<td>添加时间</td>
		 	<td>二维码图片</td>
		 	<td>累计新粉丝数</td>
		 	<td>累计老粉丝数</td>
 			<td>操作</td>
 	</tr>
 		<%--
 		<c:forEach items="${resultMap.data}" var="bean">
	 		<tr id="${bean.scene_id}">
				 	<td>${bean.sceneStr}</td>
				 	<td>${bean.createAt}</td>
				 	<td>${bean.createDate}</td>
				 	<td>${bean.actionName}</td>
				 	<td>${bean.sceneName}</td>
				 	<td>${bean.actionInfo}</td>
				 	<td>${bean.imageUrl}</td>
				 	<td>${bean.url}</td>
				<td>
					<a href="${ctx}/bvcQrCode/form?id=${bean.scene_id}">修改</a>
					<a href="${ctx}/bvcQrCode/del?id=${bean.scene_id}">删除</a>
				</td>
			</tr>	 	
	 	</c:forEach>
	 	--%>
 	</thead>
 	</table>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables.js"></script>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/jquery.dataTables_bootstrap.js"></script>
 	<script type="text/javascript" src="${ctx}/static/js/DataTables/js/dataTables.defaults.js"></script>
 	<link href="${ctx}/static/js/DataTables/css/dataTables.bootstrap.css" type="text/css" rel="stylesheet" />
 	<script type="text/javascript">
 		var table=null;
		$(function(){
			table=$("#bvcQrCodeList").DataTable({
			      "sAjaxSource": "${ctx}/bvcQrCode/${appid}/pageList",
			      "aoColumns": [
					  {"mData": "id", "sDefaultContent": ""},
					  {"mData": "sceneName", "sDefaultContent": ""},
					  {"mData": "expireseconds", "sDefaultContent": ""},
					  {"mData": "imgurl", "sDefaultContent": ""},
					  {"mData": "createTime", "sDefaultContent": ""},
					  {"mData": "url", "sDefaultContent": ""},
					  {"mData": "newUserNum", "sDefaultContent": ""},
					  {"mData": "oldUserNum", "sDefaultContent": ""},
					  {"mData": "id",
			        	"mRender":function(data){
			        	var opt='<a href="${ctx}/bvcQrCode/form?id='+data+'">修改</a>'
				        	+'<a class="btn btn-small" onclick="del(\'' + data + '\')">删除</a>';
				        	return opt;
	                   }
	                }
			      ]
			    });
		});
    	function del(id){
      		layer.confirm('确定删除?', function(){
      			$.post("${ctx}/bvcQrCode/del",{id:id},function(d){
      				table.page(table.page()).draw(false);
      				layer.msg(d.msg);
    	  			},"json");
      			});
      	  	}
 	</script>
  </body>
</html>
